<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * autores: Carlos Castillo 
 */
    if (!isset($_SESSION))
    session_start();
    
    if(isset($_GET['userq'])){
       include($_SESSION['dir'].'/Solicitud/solicitud.php');
       $temp = NULL;
       if(isset($_POST['message'])){
           $temp = new solicitud( $_SESSION["k_username"],$_GET['userq'],$_POST['message']);
            }else{
           $temp = new solicitud($_SESSION["k_username"],$_SESSION["k_username"],'Hola me gustaria agregarte a mi lista de amigos');
       }
       $temp->anadir_solicitud();
       
       header("Location: /rspinf-usb/perfil/verPerfil.php?userq=".$_GET['userq']); 
    }
        
    else 
        echo "error";
    
    
?>
